import request from '@/utils/request'
import { post } from '@/utils/request'

// 直播间列表查询
export function broadcastRoomsList(data) {
  return request({
    url: '/service-content/b/broadcast/v1/list',
    method: 'post',
    data: data
  })
}

// 查询直播间分组列表
export function groupBroadcastRoomsList() {
  return request({
    url: '/service-content/b/broadcast/v1/group/list',
    method: 'post',
    data: {}
  })
}

// 直播源列表查询（带分组聚合的）
export function liveSourceList() {
  return request({
    url: '/service-content/b/broadcast/v1/room/source',
    method: 'post',
    data: {}
  })
}

// 直播间列表分页查询
export const liveRoomPageList = p => post(`service-content/b/broadcast/v1/room/pageList`, p)

// 直播间添加
export const liveRoomAdd = p => post(`service-content/b/broadcast/v1/room/add`, p)

// 直播间修改
export const liveRoomEdit = p => post(`service-content/b/broadcast/v1/room/modify`, p)

// 微信素材上传
export const uploadWechatMaterial = p => post(`service-content/b/media/v1/upload`, p)
// 详情
export const liveRoomDetails = p => post(`service-content/b/broadcast/v1/room/view/${p}`, p, 'get')
// 删除
export const liveRoomDel = p => post(`service-content/b/broadcast/v1/room/del/${p}`, p)
// 发布
export const liveRoomStatus = p => post(`service-content/b/broadcast/v1/room/changeStatus/${p.id}/${p.status}`, p)
// 分组管理
// 列表
export const groupList = p => post(`/service-content/b/broadcast/v1/group/pageList`, p)
// 列表 select
export const groupSelList = p => post(`/service-content/b/broadcast/v1/group/list`, p)
// 查看
export const groupDetails = p => post(`/service-content/b/broadcast/v1/group/view/${p}`, p, 'get')
// 修改 保存
export const groupModifySave = p => post(`/service-content/b/broadcast/v1/group/modify`, p)
// 新增 保存
export const groupAddSave = p => post(`/service-content/b/broadcast/v1/group/add`, p)
// 删除
export const groupDel = p => post(`/service-content/b/broadcast/v1/group/del/${p}`, p, 'get')
// 成员管理
// 列表
export const anchorList = p => post(`/service-content/b/broadcast/v1/anchor/pageList`, p)
// 列表 select
export const effectiveAnchorList = p => post(`/service-content/b/broadcast/v1/anchor/list`, p)
// 状态
export const anchorStatus = p => post(`/service-content/b/broadcast/v1/anchor/changeStatus/${p.id}/${p.publishStatus}`, p)
// 查看
export const anchorDetails = p => post(`/service-content/b/broadcast/v1/anchor/view/${p}`, p, 'get')
// 修改 保存
export const anchorModifySave = p => post(`/service-content/b/broadcast/v1/anchor/modify`, p)
// 新增 保存
export const anchorAddSave = p => post(`/service-content/b/broadcast/v1/anchor/add`, p)
// 删除
export const anchorDel = p => post(`/service-content/b/broadcast/v1/anchor/del/${p}`, p, 'get')
// 直播商品管理
// 列表
export const goodsPageList = p => post(`/service-content/b/broadcast/v1/goods/pageList`, p)
// 批量添加
export const goodsBatchAdd = p => post(`/service-content/b/broadcast/v1/goods/batchAdd`, p)
// 批量添加
export const goodsView = p => post(`/service-content/b/broadcast/v1/goods/view/${p}`, p, 'get')
// 直播优惠券管理
// 列表
export const couponPageList = p => post(`/service-content/b/broadcast/v1/coupon/pageList`, p)
// 批量添加
export const couponBatchAdd = p => post(`/service-content/b/broadcast/v1/coupon/batchAdd`, p)
// 批量添加
export const couponView = p => post(`/service-content/b/broadcast/v1/coupon/view/${p}`, p, 'get')
// 基本设置
// 查看
export const settingView = p => post(`/service-system/b/broadcastSetting/v1/viewBroadcastSetting`, p)
// 保存
export const settingSave = p => post(`/service-system/b/broadcastSetting/v1/saveBroadcastSetting`, p)
